
$(document).ready(function() {
   
   
   
   
});

function send_success(r) {
	
	if (r == "") {
		
		send_done_progress();
		
	} else {
		
		send_data_error();
		
	}
	
	
	
}

function send_failed(r) {


}

function send_in_progress() {
	
	$("#indicator").html("<img src='images/loader.gif'>");
}

function send_done_progress() {
	
	$("#indicator").html("<span style='color:#0AC92B'>Thanks for your feedback!</span>");
	
}


function send_data_error() {
	
	$("#indicator").html("<span style='color:#FF0000'>An error occurred...</span>");
	
}


$("#send").click(function() {
						  
	n = $("#name").attr('value');
	e = $("#email").attr('value');
	m = $("#message").attr('value');
						  
						  
	$.ajax({url: "php/contact.php?name=" + escape(n) + "&email=" + escape(e) + "&message=" + escape(m) , cache: false})
	 .done( send_success )
	 .fail( send_failed  );
	 
	 send_in_progress();
});
	